Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set transport.Version via ldflags for release #856

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

jonjohnsonjr
Copy link
Collaborator

For most things consuming this package, they will depend on an actual
released version of go-containerregistry. When we release
go-containerregistry itself, the binaries are built at the same version
as the library, which means that they don't depend on an actual released
version of go-containerregistry, so the version in debug info is just
"(devel)". For our own release, we will just set it to the tag.


Tested via:

$ goreleaser --snapshot --skip-publish --rm-dist && ./dist/crane_linux_amd64/crane ls -v ubuntu 2>&1 | grep -i agent
User-Agent: crane/v0.2.1-next go-containerregistry/v0.2.1-next
User-Agent: crane/v0.2.1-next go-containerregistry/v0.2.1-next
User-Agent: crane/v0.2.1-next go-containerregistry/v0.2.1-next

Before:

$ goreleaser --snapshot --skip-publish --rm-dist && ./dist/crane_linux_amd64/crane ls -v ubuntu 2>&1 | grep -i agent
User-Agent: crane/v0.2.1-next go-containerregistry/(devel)
User-Agent: crane/v0.2.1-next go-containerregistry/(devel)
User-Agent: crane/v0.2.1-next go-containerregistry/(devel)

The real test will be looking at the UA of a downstream module to make sure the buildinfo stuff works.

For most things consuming this package, they will depend on an actual
released version of go-containerregistry. When we release
go-containerregistry itself, the binaries are built at the same version
as the library, which means that they don't depend on an actual released
version of go-containerregistry, so the version in debug info is just
"(devel)". For our own release, we will just set it to the tag.
@codecov-io
Copy link

Codecov Report

Merging #856 (4950c9b) into master (f937abd) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #856      +/-   ##
==========================================
- Coverage   74.32%   74.29%   -0.04%     
==========================================
  Files         106      106              
  Lines        4452     4454       +2     
==========================================
  Hits         3309     3309              
- Misses        650      651       +1     
- Partials      493      494       +1     
Impacted Files Coverage Δ
pkg/v1/remote/transport/useragent.go 47.61% <0.00%> (-5.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f937abd...4950c9b. Read the comment docs.

@imjasonh imjasonh merged commit f39a196 into google:master Dec 3, 2020
@jonjohnsonjr jonjohnsonjr deleted the ld-flags-ggcr branch December 3, 2020 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants